<script setup lang='ts'>
defineOptions({ name: 'AppSportsBetSlipSelection' })


const { } = storeToRefs(useSportsStore())

const showInput = ref(true)

function deleteItem() {
  // carCount.value = carCount.value - 1
}
</script>

<template>
  <div class="bet-slip-selection">
    <div class="close" @click="deleteItem">
      <BaseIcon name="uni-close" class="text-[24px]" />
    </div>
    <div class="info">
      <div class=" cursor-pointer">
        <!-- 联赛名 -->
        <div class="flex items-center mb-[4px]">
          <BaseIcon name="sports-football" class="text-[16px] mr-[3px]" />
          <span class="text-[12px] leading-[16px] font-semibold text-[var(--color-text-white-0)]">
            New York Knicks
          </span>
        </div>
        <div>
          <!-- 队名 -->
          <div class="text-[#ffffffbd] text-[10px] leading-[16px] tracking-[0.6px]">
            New York Knicks vs Indiana Pacers
          </div>
          <!-- 盘口 -->
          <div class="text-[#ffffffbd] text-[10px] leading-[16px] tracking-[0.6px]">
            Winner (incl. overtime)
          </div>
        </div>
      </div>
      <div class="flex">
        <AppSportsBetSlipSelectionOdds :odds="1.98" />
        <div class="flex z-[1] relative min-h-[24px] justify-end">
          <div class="flex-1 max-w-[128px] overflow-hidden trans-input" :class="{ hideInputBox: !showInput }">
            <AppSportsAmountInput class="trans-input" :class="{ hideInput: !showInput }" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang='scss' scoped>
.bet-slip-selection {
  color: var(--color-text-white-0);
  display: flex;
  overflow: visible;
  position: relative;
  background: var(--color-bg-black-4);
  transition: transform .3s;
  border-radius: 6px;
  height: 92px;

  &:not(:last-of-type) {
    margin-bottom: 8px;
  }

  .close {
    flex: 0 0 auto;
    color: var(--color-text-white-0);
    width: 40px;
    cursor: pointer;
    display: flex;
    background: var(--color-bg-black-5);
    align-items: center;
    border-radius: 4px 0 0 4px;
    justify-content: center;
  }

  .info {
    flex: 1;
    display: block;
    padding: 8px 16px 8px 8px;
    z-index: 1;
    position: relative;
    text-decoration: none;
  }
}

.trans-input {
  transition: all 300ms linear;
  opacity: 1;
  transform: translateX(0);
}

.hideInputBox {
  opacity: 0;
  transform: translateX(100%);
}

.hideInput {
  transform: translateX(-100%);
}
</style>
